package daily.aug0813;

import java.io.File;

public class FileMethod_TraverseDir {
    public static void main(String[] args) {
        File file01 = new File("D:\\Development");

//        list()方法
        String[] fileList01 = file01.list();
        for(String fileName : fileList01){
            System.out.println(fileName);
        }
//        输出结果:
//        Developer
//        eclipse
//        IntelliJ IDEA
//        java-1.8.0-openjdk-1.8.0.252-2.b09.redhat.windows.x86_64.zip
//        LLVM
//        Microsoft VS Code
//        MySQL
//        openjdk-1.8.0.252-2.b09.redhat.windows.x86_64


//        listFiles()方法
        File[] fileList02 = file01.listFiles();
        for (File file:fileList02){
            System.out.println(file);
        }
//        输出结果:
//        D:\Development\Developer
//        D:\Development\eclipse
//        D:\Development\IntelliJ IDEA
//        D:\Development\java-1.8.0-openjdk-1.8.0.252-2.b09.redhat.windows.x86_64.zip
//        D:\Development\LLVM
//        D:\Development\Microsoft VS Code
//        D:\Development\MySQL
//        D:\Development\openjdk-1.8.0.252-2.b09.redhat.windows.x86_64
    }
}
